import type { ComponentType, LazyExoticComponent } from "react";
import React, { Suspense } from "react";
import Loading from "@/components/Loading";

const Lazyload: React.FC<{ children: LazyExoticComponent<ComponentType<any>> }> = ({ children }) => {
  return <Suspense fallback={<Loading />}>{React.createElement(children)}</Suspense>;
};

export default Lazyload;
